package com.efast.cafe.portal.service.api.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.efast.cafe.framework.util.SpringWebUtils;
import com.efast.cafe.portal.bean.api.PackagePublishIndentifierBean;
import com.efast.cafe.portal.dao.api.PackagePublishIndentifierDao;
import com.efast.cafe.portal.dao.api.PackagePublishIndentifierDefDao;
import com.efast.cafe.portal.service.api.IPackagePublishIndentifierService;

import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>Service接口实现类</p>
 * <p>Table: package_publish_indentifier - 打包发布标识</p>
 *
 * @since 2017-08-10 02:39:31
 */
@Service
@Transactional
public class PackagePublishIndentifierServiceImpl implements IPackagePublishIndentifierService{

	private PackagePublishIndentifierDao packagePublishIndentifierDao;
	
	private PackagePublishIndentifierDefDao packagePublishIndentifierDefDao;
	@Autowired
	public void setPackagePublishIndentifierDao(PackagePublishIndentifierDao packagePublishIndentifierDao) {
		this.packagePublishIndentifierDao = packagePublishIndentifierDao;
	}

	@Autowired
	public void setPackagePublishIndentifierDefDao(PackagePublishIndentifierDefDao packagePublishIndentifierDefDao) {
		this.packagePublishIndentifierDefDao = packagePublishIndentifierDefDao;
	}


	/**
	 * 新增PackagePublishIndentifier
	 * {@inheritDoc} 
	 * overridden:
	 * @Date        :      2017年8月14日
	 * @see com.efast.cafe.portal.remote.api.PackagePublishIndentifierService#insertPackagePublishIndentifier(com.efast.cafe.portal.bean.api.PackagePublishIndentifierBean)
	*
	 */
	@Override
	public int insertPackagePublishIndentifier(PackagePublishIndentifierBean packagePublishIndentifierBean) {
		packagePublishIndentifierBean.setCreateUser(SpringWebUtils.getRequestUser());
		packagePublishIndentifierDao.insertPackagePublishIndentifier(packagePublishIndentifierBean);
		packagePublishIndentifierDefDao.insertPackagePublishIndentifierDef(packagePublishIndentifierBean.getModuleId(), packagePublishIndentifierBean.getId(), SpringWebUtils.getRequestUser());
		return packagePublishIndentifierBean.getId();
	}
	
	
}